# Importing Data
SLOVAKIA<- read_excel("C:/users/Biniam/Desktop/Documents/Academic/Thesis/Analysis Folder/Excel Files/Steel/TSA.xlsx",sheet = "Sheet1", range = "AD1:AD239")

# Checking the Imported Data
View(SLOVAKIA)
# Creating Time Series Data
SLOVAKIA_ts <- ts(SLOVAKIA, start=c(2000,1), end=c(2018 ,12), frequency=12)
# Viewing and Checking the Created Time Series Data
SLOVAKIA_ts
sum(is.na(SLOVAKIA_ts))
library(forecast)
SLOVAKIA_ts <- tsclean(SLOVAKIA_ts)
SLOVAKIA_ts

# Identification: Plotting the Time Series Data
plot(SLOVAKIA_ts)

# Estimating the appropriate model
SLOVAKIA_ts_model <- auto.arima(SLOVAKIA_ts)
SLOVAKIA_ts_model

# Forecasting
options(max.print=1000000)
SLOVAKIA_ts_forecast <- forecast (SLOVAKIA_ts_model, level=c(95), h=264)
plot(SLOVAKIA_ts_forecast)
SLOVAKIA_ts_forecast             

# Exporting
write.table(SLOVAKIA_ts_forecast, file="/users/Biniam/Desktop/Documents/Academic/Thesis/Result Folder/TSA Results/Excel Files/From R/Steel/SLOVAKIA_TSA.csv", sep=",")
